const phantom = require('phantom')

async function htmlToPdfModel() {
  const instance = await phantom.create();
  const page = await instance.createPage();
  await page.on('onResourceRequested', function(requestData) {
    console.info('Requesting', requestData.url);
  });
  
  const status = await page.page.setContent('../public/12.html');
  const content = await page.property('content');
  // console.log(content);
  await page.render('./101.pdf')
  await instance.exit();
  return {}
}

module.exports = {
  htmlToPdfModel
}